package com.qipay.mapper;

import com.qipay.baas.model.OperateLog;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.List;
import java.util.Map;

/**
 * Creator: Yao
 * Date:    2017/10/13
 * For:
 * Other:
 */
@Mapper
public interface OperateLogMapper extends com.qipay.baas.mapper.OperateLogMapper{

    @SelectProvider(type= OperateLogSqlProvider.class, method="selectByUidAndType")
    @Results({
            @Result(column="id", property="id", jdbcType= JdbcType.INTEGER, id=true),
            @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
            @Result(column="service", property="service", jdbcType=JdbcType.VARCHAR),
            @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
            @Result(column="operate_date", property="operateDate", jdbcType=JdbcType.TIMESTAMP),
            @Result(column="url", property="url", jdbcType=JdbcType.VARCHAR),
            @Result(column="method", property="method", jdbcType=JdbcType.VARCHAR),
            @Result(column="param", property="param", jdbcType=JdbcType.VARCHAR),
            @Result(column="info", property="info", jdbcType=JdbcType.VARCHAR)
    })
    List<OperateLog> selectByUidAndType(Map<String, Object> params);

    @SelectProvider(type=OperateLogSqlProvider.class, method="countByUidAndType")
    long countByUidAndType(Map<String, Object> params);
}
